//app.js
var request = require("./utils/request.js").default;
var util=require("./utils/util.js");
App({
  onLaunch: function () {
    let token = wx.getStorageSync("token") ? wx.getStorageSync("token"):'';
    this.globalData.token = token;

    console.log(wx.getSystemInfoSync());
    let screenHeight=wx.getSystemInfoSync().screenHeight;
    let safeArea=wx.getSystemInfoSync().safeArea;
    this.globalData.safeArea=screenHeight-safeArea.bottom;
  },
  userlogin:function(){//没有登录 去登录
    // wx.navigateTo({
    //   url: '/pages/login/login'
    // })
    wx.showToast({
      title: '请先登录！',
      duration: 1000,
      icon: 'none',
      success: () => {
        setTimeout(() => {
          wx.switchTab({
            url: '/pages/my/my'
          })
        }, 1000)
      }
    })
  },
  globalData: {
    token:'',
    safeArea:0,
    imgUrl:'https://dyhd.doing.net.cn',
    cateId:'',//分类一级Id
  },
  requestJs:request,
  utilJs:util,
})